import React, { lazy } from 'react'
import { Navigate } from 'react-router-dom'

import Home from "@/views/home"

const Detail = lazy(() => import('@/views/detail'))

const routes = [
    {
        path: '/',
        element: <Navigate to="/home"/>
    }, {
        path: '/home',
        element: <Home/>
    }, {
        path: 'detail',
        element:
        <React.Suspense fallback={<div>Loading...</div>}>
            <Detail name="Detail"/>
        </React.Suspense>
    }
]

export default routes
